import Vue from 'vue';

Vue.directive('scroll', {
  bind: function(el, binding, vn) {
    if (vn.context.static) {
      return;
    }
    const scrollHandler = function(eventArgs) {
      binding.value(eventArgs, el);
    };
    window.addEventListener('scroll', scrollHandler);
    // window.onscroll = scrollHandler;
  },
});
